/**
 * @file /include/unicebot_gui/qnode.hpp
 *
 * @brief Communications central!
 *
 * @date February 2011
 **/
/*****************************************************************************
 ** Ifdefs
 *****************************************************************************/

#ifndef unicebot_gui_UNICEBOTNODE_HPP_
#define unicebot_gui_UNICEBOTNODE_HPP_

/*****************************************************************************
 ** Includes
 *****************************************************************************/

#include <ros/ros.h>
#include <string>
#include <QThread>
#include <QStringListModel>

#include "KinectWidget.hpp"
#include "ImageConverter.hpp"

/*****************************************************************************
 ** Namespaces
 *****************************************************************************/

namespace unicebot_gui {



/*****************************************************************************
 ** Class
 *****************************************************************************/

class UnicebotNode: public QThread {
Q_OBJECT
public:
	UnicebotNode(int argc, char** argv, KinectWidget* pKinectWin );

	virtual ~UnicebotNode();
	bool init();
	bool init(const std::string &master_url, const std::string &host_url);
	void run();

	/*********************
	 ** Logging
	 **********************/
	enum LogLevel {
		Debug, Info, Warn, Error, Fatal
	};

	//QStringListModel* loggingModel() { return &logging_model; }

	KinectWidget* pKinectWin;
	ImageConverter imageConverter;

	bool stop;

signals:
	//void loggingUpdated();
	void rosShutdown();

private:
	int init_argc;
	char** init_argv;

	//ros::Publisher chatter_publisher;
	//QStringListModel logging_model;
};

} // namespace unicebot_gui

#endif /* unicebot_gui_UNICEBOTNODE_HPP_ */
